package dimensional.traveler.server.persistence.mock;

import java.util.ArrayList;
import java.util.List;

import dimensional.traveler.server.model.CharacterClass;
import dimensional.traveler.server.model.Faction;
import dimensional.traveler.server.persistence.CharacterClassRepository;

public class MockCharacterClassRepository implements CharacterClassRepository {

	private ArrayList<CharacterClass> characterClasses = new ArrayList<>(3);

	public MockCharacterClassRepository(){
		
		Faction deltaForce = new Faction();
		deltaForce.setId("delta-force");
		deltaForce.setName("Delta Force");
		deltaForce.setDescription("Delta Force is one of the United States' secretive tier-one counter-terrorism and Special Mission Units. Along with the Navy Seals, it is the United States military's primary counter-terrorism unit. As such, its members are highly trained in to withstand any combat situation, including, but not limited to, hand-to-hand combat and highly effective use of firearms.");
		
		Faction cia = new Faction();
		cia.setId("central-intelligence-agency");
		cia.setName("CIA");
		cia.setDescription("The Special Activities Division of the United States Central Intelligence Agency is responsible for covert operations including both paramilitary and political action.");
		
		String commandoDescription = "A typical commando is highly versatile, being adept at both combat and infiltration.";
		CharacterClass dfCommando = new CharacterClass("df-commando", "Delta Force Commando", commandoDescription);
		dfCommando.setFaction(deltaForce);
		dfCommando.setEnabled(true);
		characterClasses.add(dfCommando);
		
		String medicDescription = "A typical field medic gives up advanced weapons training for medical knowledge, although he is still highly capable by all military standards.";
		CharacterClass dfMedic = new CharacterClass("df-medic", "Delta Force Field Medic", medicDescription);
		dfMedic.setFaction(deltaForce);
		dfMedic.setEnabled(false);
		characterClasses.add(dfMedic);

		String agentDescription = "A typical agent is an expert at hand-to-hand combat and small arms, while also secretive, diplomatic and observant.";
		CharacterClass ciaAgent = new CharacterClass("cia-agent", "CIA Agent", agentDescription);
		ciaAgent.setFaction(cia);
		ciaAgent.setEnabled(false);
		characterClasses.add(ciaAgent);
	}
	
	@Override
	public List<CharacterClass> getCharacterClasses() {
		return characterClasses;
	}

	@Override
	public CharacterClass getCharacterClassById(String characterClassId) {
		for (CharacterClass characterClass : characterClasses){
			if (characterClass.getId().equals(characterClassId))
				return characterClass;
		}
		return null;
	}

}
